updated assignment
eliminated the for loops