ok i changed my sunroof yesterday, and found my old sunroof sitting on 2 shims on one corner while 2 front corners were on 1 shim each and the final corner had none

what do these shims do exactly and how do i know i have the correct amount under each corner for my new roof? i simply replaced them where they came, is this right or would a new roof require different amount or distrution of said shims
i can press down on the sunroof and it moves slightly, but the old one did the same, should this be so? or does it need to be sitting tight (no noticable movement)