Doesn't quite work yet. THings are getting more complicated than they should be