Renaming startTracking to processFrame and changing its structure. Adding comments and removing unused code.