Pipeline is functional. Still needs some commenting and cleaning up.