Works! Messy code, gotta cleanup