remove whiles, add more test and square method