updating code for term plan