Adding set() method (fixes #3)