Added codes and updated documentation