remove magic numbers; reduce compiler warnings