added copyright header, added some javadoc, cleaned up imports