Stripped out unnecessary stuff and added more printout