solved investement problem