further merged optimizations, added labels