added necessary documentation to the codes