AI code commented, now need to be refactored