WIP - lots of messy, redundant code as I figure stuff out