added a few comments/documentation. Altered a few spots to work in BlueJ