finalized functions and outputs

fixed the functions, added functions, and added outputs of the
functions and variables.