proper test system->a few bugs found and corrected