rewrote the entire program - requires templating, its a messy html