added code for parsing country, changed page number scheme