cleaned up code some more