played with optimizations