decimator fix bugs, improve efficiency