More OO code, minumum fixes. Added some javadoc