Solution in 60 lines. I really don't see any need for OOP in this sample.