modified code, added constants