reworking entire script