Front end code sucks, going to redo