Code fixes, need AI improvements though