bugs solved + speedup when saving