Added "build" and "save" functions.