reorganized, updated compiler warnings