updated js program to try to get it to work