created backward.java and forward.java