Fixed some errors and changed the mechanics of some things.