Second and third parts of the program changes, It need to be run and tested with the prfessor