Shortened some functions and took out a little redundency.