Got this kind of working a lot better - still want to add functionality