this is the best solution so far but it's fucked