Trying to make code more reusable

Working around the path making functions. Also, random range function
added.