updated to new algo!