Update: Removed extra braces near for loop