added basic algorithms in revp.py