Updated JS

Added more functionality