more final version - changed some values in the inRange() function