Implemented own data structures, and Subset is optimized