remove prints, fix bugs and documentation