simpler implementation of backdoor.py