Changes in class Coordinates: Refactored if conditions to be more clear and wrapped the body of the if statements in curly brackets. Added 'this.' prefixes to the member items.