Added JS solution