Refactored the variables code, deleted useless definitions.