how the phases of the moon relate to the length of the month