this works for the basic cases. Need to write unit tests, instead of just typing them. :-"