redid the front end and simplified a bit