change some code a little
add bool type, also export if to user space