Put functions where they were missing.

Changed the variable names so they wouldn't clash with function names.