refactored problem 003.
refactored problem 003.
refactored problem 002.
refactored problem 001.