adding notes and previous code