cleaned up code a lil