Shifted function to fun.py