Clean up loops. Set up page template. Add HR logic.