Re-write of commands.java