added js functions
added js functions
cleaned up