Complete rewrite! Hopefully this works :P