rearranged for installing. Need to fix now
fixed some bugs
should have been added