AI changes, cleaning up of code, better comments