Added function body for all control functions.
Fixing compiler errors, function name errors