add debug script
updated tests
updated fd