Numerous fixes. Added executable. Fixed some code that passed the tests but failed irl