make arg names consistent
move some constant defs to top of file