Cleaned up code a LOT