fixed numerous errors