slowly adding ajax functionality