Added conditional and action into one function.
Merge branch 'master' of https://github.com/adamsbriand/CS185.git