Theoretical explinations and code cleanup for older problems