more work on traps implementation
fix binary arithmetic