Got the basic case working using generics for the Element class