EXTREMELY buggy Ninja code