Basic framework for sending commands
Added more functionality