cleaned up some variable names and function names