Changes to index.php. Better calculations. Confuguration added to the top of the file