tweaked the server side code, improved the front-end a bit