After much fiddling with classes