Add extra functions and writeStore (#2)