The starting point. After a bunch of trial and error, this is now somewhat usable