page addding now implemented in c. for some reason, pages after page0 are appearing black. filled with zeros for unknown reason.