removed unnecessary continue statement
removed unnecessary return statements
compare strings with equals
removed cast