removed unecessary loop