Sam isn't too much of a goody-two-shoes, like some Horatio Alger heroes. He even tries to rob his roommate. Then he moves to Boston for a new start and decides to try to become respectable. He walks up Tremont street stopping in all the stores looking for work. Sam stumbles into a great job in the usual Alger way and becomes quite successful.
Horatio Alger Jr. ; January 13, 1832 – July 18, 1899) was a prolific 19th-century American writer, best known for his many young adult novels about impoverished boys and their rise from humble backgrounds to lives of middle-class security and comfort through hard work, determination, courage, and honesty. (Excerpt from Wikipedia)