added code for list.java