changing to ifelse function
Merge pull request #1 from helenphillips/fixingbuild

changing to ifelse function