Rewrite checkLine(). Not completed