Process optimization and trouble shooting