implemented basic value function, will need work