reverse function

Simulations for reverse-engineering