got working map put/get
cleaned up code