code cleanup + speedup (faster frame reading), minor fixes (linq orderby)