added done signal so that the process stops when its done
modified testbench so that it handles a more complex key