added better versioning, small performance improvements when not using debug mode