corrected most of the issues detected by Olga