Bug fixes, and got the expected output for all but number 10