adds more sudo code for pagination