lots of changes to alg. splitting up the different methods into separate functions. Current optimization is lm break. Starting point for what I think is going to be the correct way