Added good front end and fixed bugs