Tired of working on this, so here it is.