fixes, code analysis (I HATE CODE ANALYSIS) and refactors and maybe making stuff work