Initial draft
Moved usage on top and added some error checking