notes and refactor w giles!