Nick O: Added some javadoc and tests