fix flow error as return is unreachable (clang++ -Wunreachable-code)
mark standalone functions static
cleanup unused code
remove uneeded semicolons
remove uneeded semicolons
static decl and correct float comparision
Add missing test file