added constants for frequently used variables, renamed register named variables where the purpose is known