attempt at rendering with nested loops