Algorithm that calculates markups