Creation At Ugarit and in the Old Testament

One way of stating the problem of creation at Ugarit is to ask a question. Is the conflict between Baal and Yamm related to kingship, temple building, or creation? Many times, in a lecture or in a conversation, I have heard it said that the battle between Baal and Yamm in Ugaritic literature is a creation myth. This view is very appealing to me, but it is, at the same time, very difficult. The fact is that most Ugaritic scholars say that the battle only results in kingship.