simplified the "set" function