some optimizations (added constants where appropriate).