updated and included many minor and major fixes