Added proper brace counting, fixed return value on empty functions, added detection for lines with class keywords in comments and skips those