refactored some names / algebra