A simple class hierachy

http://ideone.com/Po2er7