My algorithm is bad.