Initial code for data gathering javascript