reworked a bit