changed structure of getting coordinates