re-arranged and added to functions.php. closes #43, started on #41
merged functions-php