fixed varargs error on from-to range cuts, refactored code
fixed varargs error on from-to range cuts, refactored code

noyeitan/cubes,zejn/cubes,ubreddy/cubes,cesarmarinhorj/cubes,cesarmarinhorj/cubes,cesarmarinhorj/cubes,pombredanne/cubes,ubreddy/cubes,she11c0de/cubes,she11c0de/cubes,jell0720/cubes,noyeitan/cubes,jell0720/cubes,pombredanne/cubes,jell0720/cubes,zejn/cubes,she11c0de/cubes,pombredanne/cubes,noyeitan/cubes,ubreddy/cubes,zejn/cubes