A toy variant implementation I felt like writing.