Made outOfRange a non static method. So I can access member variables without an object instance.
Wrote a custom outOfRange function and modified the constructor to use outOfRange.