adding tests and removing some debug prints