pass lab 4 part B (tested for 100 times without failure)