Algorithm Perfect!