reworking JS