reworking main