Fix html and
changing function

simplifying function