working on ending value