added the value class plus minor modifications