Remove unused reachedEnd() function