Made range finding into a function, made the object stuff actually matter.