new version uses less memory