sketched some of the split up code