added polygon code to navigator.java.