Global behaviour of the period function for some degenerate centers