a lot of improvements are needed, but this is starting to get in shape