Made numerous changes and several improvements