completes re-write, optimized, prepped for MVC