implement + test checkEnd()