add coordtype param to coordinate func