removed nesting, use inline conditional

haven't tested this.. should write tests before...