changed many console printouts to assertions