Refactor all functions using coordinates to receive entire coordinate as parameter instead of individual numbers.