write dashboard code