Previous page function final version.