Changed script to dynamically produce paginator
'