math fix and random direction&partsCount