added renderpage. Needs testing.