Cleaned some things up a bit. Started temp functions.