thinking through this code