added 3 versions of code.