Added more command logic, also added some javadocs