working version, but still needs to have the overlay div be calculated, and not in index.html