Wrote the public prev and did a small test in main.