removed unneccessary loop