adding beginning of shared.php. Will finish later