implemented a coordinate class