remove print, improve error reporting
improved tests