modularized buildperms in perms.jl