Removed unused function checkRange() and a bunch of commented out lines.