try to speed things up by using the trove library to represent int list
(instead of standard ArrayList)