new design and algorithim