Finally got everything working (pretty much\! except for the ajax