began splitting up the code