working 3 fixed algo