Fixed generating lakes at y = 255, rewritten some classes