fixed Algorithm stuff