almost fixed the mess