update equation to ensure it starts from 0