remove unuseful code
add get_square_positions and cache its result