add main page and rrelated code