finish testing
fix minor bugs