rewrote more scancode stuff