finished js skeleton

added all of the functions