Added AJAX and fixed some other bugs :P