Complete implementation of set and get.