annotated all of the functions in js file