Added code from two more questions
Merge branch 'master' of https://github.com/afester/StackOverflow