modified first problem