integrating stuff from instructor