removed unecessary looping