added "get" method similar to dict.get in python