Added analytics code, cleaned up layouts.