merged header and footer, fix bugs...