works but with glitches