some jank rewrite