document variable optimization
fix some browser issues