account for edge cases
Added printing