fixed part of algorithm calculation