faster implementation of latest