Revamped code

Fixed lots of bugs, made commands into functions, yay!