1. change structure of program
2. add pip algorithm