Merge pull request #6 from fantasticfears/master

cast bool logic to bool type
Optimizations further
del phi node return value
save value for output
call func