Switched from arrays to ArrayLists, more test cases, more docs