Completed temporary version

This is the completed version that I will use for now. It is likely that there is a better way to do almost all of this.