removed nested for looping