alternative implementations for speed