removed innerHTML, separated function