fixed algorithm a bit