Newborn sleep

Why is my newborn kicking her legs up when she sleeps? Is this to relieve gas?