Sam fixed OutofBoundException. Encountering NullPointerException.
Test Codes. NOT FOR THE ASSIGNMENT!