improved bindings
changed bool to int and bug fix