Added save function
Fixed bug which caused mirrored parts not to be print