Did some more logic and variable name changes