added code for dynamically creating calendar