Tried to wrap all the js into a load function