Remove Loops

Removed some unnecessary loops through vectorization for a small saving
of computation time