Yay, complete rewrite for funsies.