bug fixes and print statements