updated from Coursera version to my version