restructured code for the full page w preview