minor fixes and replaced constants