JS code for review --KW