made some more changes to my alg