Hey there,
I actually just found another way to do it which was easy.
I went to admin, settings, reading,
In there I was able to change the blog pages show at most from 10 to 5.
It gave me the result I needed.
Would there be any difference in the result between doing it this way or with the php files?