reworked everything taking cursor position to work with coordinates