prepped for ps1 problem c