did some fixes and improvements, 24 passing tests