lots of logging, error handling and logic changes