something starting working...
bug fixes, plus tests