Cleaned up some stuff and added JavaDocs