cleaned up code a TON