Added johannes optimizations