added ajax and other niceties