start making code more readable, renaming
refactored some function