Implementation of put and get (not tested yet)