added distinct argument for coord function