fixed all bugs found before final due