pep8
collapsed random_valid_coordinate to tuple
deque for performance enhancements