Added debug and requestanimation functions