Finished wrapping workflow in functions. Created simplified workflow logic