refactoring v1.3

renamed variables and refactoring code