Changed range option parsing to a simpler code