work on tests, fixes and features, seems to work