added polygon code to navigator.java.

yea for pull requests.