flipping fantastic

more flipping functionality and moved php loading out of index.php