Refactored State:update a bit, preparing to add volume avoidance term.