Adding fermat script