Updated code from Tuesday for ms3