Trying new method for Problme 3