fixed all outstanding bugs