Function Chopping

Put everything in fuctions and added level per class