refactored direction,coordinate