with JS functions