add needed and count to contract