Added several new commands and cleaned up code