updated javascript file with functions for more instructions