Moved buyCigarettes code into another method.