Updated JS Functions