improve problem 1 structure
beautify problem 2