1) Cleaned up code a little