JS code now works!!!