Added closing brace to overall function