Working version of index with Flask