Cleaned up the code and variable names