adding the entire set of instructions and modifications after testing and debugging