fixed the bugs hopefully

created a solution, at least