some general clean up
updated constants to make locks work