looooking at my algorithm