Removed nested loop for testing