Small speed improvement to previous