removed unrequired temp variable, improved formatting