Optimization of code

removal extra return statements and fixed = operator error within a conditional.