Added a method to generate 2D coordinates