save function added with documentary