refactoring
added seperate profit calculations
refactored