Changed names and refactored some variables