Thank you very much for your appreciation, really, it's very inspiring.

To Esgici:

There are many algorithm in calculating the lunar calendar, like for example the Kuwaiti Algorithm used by Microsoft to calculate Hegira dates. Lunar calendar used by Chinese, Vietnamese and by Jewish. Would you mind to clarify which lunar calendar are we talking about?

Take note that Islamic lunar calendar used in Saudi Arabia is used mainly as civil calendar meaning they are not using it for religious purposes. To determine the begining of Ramadan, they rely on visible sightning of the crescent moon. At midnight if they sighted the moon anyone will call/or inform the nearest Mosque regarding the sigthing of the crescent moon. That would marked the beginning of Ramadan. So on the civil calendar the Begining of Ramadan is just a tentative which moved accordingly to the sighting of the moon. So as you can see they spend a week or more to watch the sky for seeing the moon.

On the otherhand, calculating the phases of the moon(full moon, new moon, waxing gibous, waxing crescent, waning gibous, waning crescent) uses a different set of algorithm much like the algorithm of calculating the sunrise and sunset. However in triangulating/calculating the position is little more complicated because of fast movement of the moon that revolves around the earth as compared with earth revolves around the sun.