Started cleaning up front-end, needs testing and slight modifications