fixed remove min bugs; expand array size dynamically