* reduce the size of basket[]
* using global variable to replace function parameter