Command functions?

I just quickly through this together. I think I broke all sorts of
programming rules...