broke code down into methods