Added more print line statements  + algo fix