init code commit

based on the inital pass at https://gist.github.com/codearachnid/5490224