fix many of the issues