fixed blue tinting, made minor optimizations