removed nesting, use inline conditional

haven't tested this.. should write tests before...
Merge pull request #1 from bruslim/patch-1

removed nesting, use inline conditional