move everything over to jquery and write presence properly