simplified javascript