reworked everything (almost)