fx for parts of algorithm