Updated code logic and notes.