Adds ABC analysis and cleans up code to meet minimum