remove empty lines at beginng/end and draw last line/cut mark