wrote constructor for cooridinate class