stricter function inputs, all commands output 4 bytes, cleaned up code/comments