add animFrame drawing and also removed incorrect global variables