Removed messy output
Added integer range list
Simplified loop logic