using function instead of instance variable
Merge pull request #42 from bonniecpk/bug1

using function instead of instance variable