minh's current Part A implementation