began incorporating closure code into old js