bug fixes and print statements clean