diff --git a/build/lib/iexcode/instruments/ARPES.py b/build/lib/iexcode/instruments/ARPES.py
index c256ea796b1942b821c105c1e7932cf8476832f6..5237aa116e883b803111df6a0f6a03f7fe076567 100644
--- a/build/lib/iexcode/instruments/ARPES.py
+++ b/build/lib/iexcode/instruments/ARPES.py
@@ -8,7 +8,7 @@ from iexcode.instruments.IEX_endstations import Endstation
 
 from iexcode.instruments.files_and_folders import check_run,make_user_folders,folder_mda
 from iexcode.instruments.staff import staff_detector_dictionary
-from iexcode.instruments.xrays import xrays_detector_dictionary,xrays_reset,xrays_get_all
+from iexcode.instruments.xrays import _xrays_detector_dictionary,_xrays_reset,xrays_get_all
 
 from iexcode.instruments.conversions_constants import *
 from iexcode.instruments.utilities import *
@@ -125,7 +125,7 @@ def ARPES_detector_dictionary(xrays=True):
 
     #add detectors related to beamline
     if xrays: 
-        det_dict.update(xrays_detector_dictionary())
+        det_dict.update(_xrays_detector_dictionary())
     return det_dict
 
 def ARPES_motor_dictionary():
@@ -229,7 +229,7 @@ def ARPES_reset(**kwargs):
         tey.reset()
 
     #resetting mono and other beamline stuff
-    if iex.BL.xrays:
+    if i_xrays_reset:
         xrays_reset()
 
     #reseting the ARPES Lakeshore
diff --git a/iexcode/instruments/ARPES.py b/iexcode/instruments/ARPES.py
index c256ea796b1942b821c105c1e7932cf8476832f6..01feb7834e796e6cd8df0729f3611beed9109fab 100644
--- a/iexcode/instruments/ARPES.py
+++ b/iexcode/instruments/ARPES.py
@@ -5,10 +5,11 @@ from epics import caget,caput,PV
 
 import iexcode.instruments.cfg as iex
 from iexcode.instruments.IEX_endstations import Endstation
+from iexcode.instruments.cameras import _enable_endstation_cameras
 
 from iexcode.instruments.files_and_folders import check_run,make_user_folders,folder_mda
 from iexcode.instruments.staff import staff_detector_dictionary
-from iexcode.instruments.xrays import xrays_detector_dictionary,xrays_reset,xrays_get_all
+from iexcode.instruments.xrays import _xrays_detector_dictionary,_xrays_reset,xrays_get_all
 
 from iexcode.instruments.conversions_constants import *
 from iexcode.instruments.utilities import *
@@ -26,9 +27,6 @@ from iexcode.instruments.Lakeshore_335 import Lakeshore_reset
 from iexcode.instruments.electron_analyzer import EA_init_Motors,folders_EA,EA
 
 default_ioc = '29idARPES:'
-#detector objects used with in module and returned by init
-global tey, ca15
-
 #############################################################################
 def ARPES_init(*userName,**kwargs):
     """
@@ -53,11 +51,13 @@ def ARPES_init(*userName,**kwargs):
     physical_motors = ['x','y','z','th','chi','phi']
     psuedo_motors = ['focus']
     global ARPES_Motors
-    ARPES_Motors = Motors('ARPES',ARPES_motor_dictionary(),physical_motors,psuedo_motors)
+    ARPES_Motors = Motors('ARPES',_ARPES_motor_dictionary(),physical_motors,psuedo_motors)
 
     #endstation
     iex.BL = Endstation('ARPES',kwargs['scan_ioc'],kwargs['xrays'],kwargs['BL_mode'],ARPES_Motors)
-    
+    iex.BL.safe_state = ARPES_safe_state
+    iex.BL.endstation_get = ARPES_get_all
+
     #setting folders
     if kwargs['set_folders']:
         if iex.BL.mode == 'staff':
@@ -71,7 +71,7 @@ def ARPES_init(*userName,**kwargs):
         folders_ARPES(user_name,**kwargs)
 
         #update for default scanRecord advanced parameters
-        iex.BL.mda.log('ARPES',user_name,ARPES_log_header(),ARPES_log_entries)
+        iex.BL.mda.log('ARPES',user_name,_ARPES_log_header(),_ARPES_log_entries)
 
     #EA
     if EA.connected: 
@@ -89,6 +89,9 @@ def ARPES_init(*userName,**kwargs):
     if kwargs['reset']:
         ARPES_reset(**kwargs)
     
+    #enable cameras
+    _enable_endstation_cameras()
+    
     print ('ARPES initalized')
     #return any detectors or other parameters that you want access to from jupyter
     return tey,ca15
@@ -96,7 +99,7 @@ def ARPES_init(*userName,**kwargs):
 ##############################################################################################################
 ##############################             ARPES detectors and motors         ##############################
 ##############################################################################################################
-def ARPES_detector_list():
+def _ARPES_detector_list():
     """
     list of detectors to trigger 
 
@@ -105,7 +108,7 @@ def ARPES_detector_list():
     ca_list=[["c",1],["b",15],["b",4],["b",13]]
     return ca_list
 
-def ARPES_detector_dictionary(xrays=True):
+def _ARPES_detector_dictionary(xrays=True):
     """
     returns a dictionary of the default detectors for the scan record
 
@@ -125,10 +128,10 @@ def ARPES_detector_dictionary(xrays=True):
 
     #add detectors related to beamline
     if xrays: 
-        det_dict.update(xrays_detector_dictionary())
+        det_dict.update(_xrays_detector_dictionary())
     return det_dict
 
-def ARPES_motor_dictionary():
+def _ARPES_motor_dictionary():
     """
     returns a dictionary with  {name:[rbv,val,spmg,pv]}
     """
@@ -213,10 +216,11 @@ def ARPES_reset(**kwargs):
     if iex.BL.mode=='staff':
         iex.BL.mda.detector_dictionary = staff_detector_dictionary(kwargs['xrays'])
     else:
-        iex.BL.mda.detector_dictionary = ARPES_detector_dictionary(kwargs['xrays'])
-    iex.BL.mda.trigger_dictionary = ARPES_trigger_dictionary(**kwargs)
-    iex.BL.mda.scan_before_sequence = ARPES_scan_before_sequence(**kwargs)
-    iex.BL.mda.scan_after_sequence = ARPES_scan_after_sequence(**kwargs)
+        iex.BL.mda.detector_dictionary = _ARPES_detector_dictionary(kwargs['xrays'])
+    iex.BL.mda.trigger_dictionary = _ARPES_trigger_dictionary(**kwargs)
+    iex.BL.mda.scan_before_sequence = _ARPES_scan_before_sequence(**kwargs)
+    iex.BL.mda.scan_after_sequence = _ARPES_scan_after_sequence(**kwargs)
+    
     #resetting the scanRecord
     print("resetting the scanRecord - "+iex.BL.ioc)
     iex.BL.mda.reset_all()
@@ -230,7 +234,7 @@ def ARPES_reset(**kwargs):
 
     #resetting mono and other beamline stuff
     if iex.BL.xrays:
-        xrays_reset()
+        _xrays_reset()
 
     #reseting the ARPES Lakeshore
     pv = "29idARPES:LS335:"
@@ -253,15 +257,16 @@ def ARPES_get_all(verbose=True):
     vals={}
 
     #sample position
-    motor_dictionary = ARPES_motor_dictionary()
+    motor_dictionary = _ARPES_motor_dictionary()
     for motor in motor_dictionary.keys():
         vals[motor]=ARPES_Motors.get(motor,verbose=False)
         
-    #endstation pvs
+    #endstation/branch pvs
     extra_pvs = ARPES_extra_pvs()
     for key in extra_pvs.keys():
         vals.update(key,caget(extra_pvs[key]))
-    vals.update('exit_slit',slit3C_get())
+    if iex.BL.xrays:
+        vals.update('exit_slit',slit3C_get())
 
     #beamline info
     if iex.BL.xray:
@@ -269,8 +274,11 @@ def ARPES_get_all(verbose=True):
         vals.update(beamline_info) 
 
     if verbose:
+        print("-----------------------------------------------------------")   
         for key in vals:
             print(key+" = "+vals[key])
+        print("-----------------------------------------------------------")   
+
     return vals
 
 
@@ -278,14 +286,14 @@ def ARPES_get_all(verbose=True):
 ##############################################################################################################
 ##############################             logging           ##############################
 ##############################################################################################################
-def ARPES_log_header():
+def _ARPES_log_header():
     header_list={
         'EA': "scan,x,y,z,th,chi,phi,T,scan_mode,E1,E2,step,i,f,PE,lens_mode,SES slit #,hv,exit_slit,GRT,ID_SP,ID_RBV,ID_Mode,ID_QP,TEY1,TEY2,time,comment",
         'ARPES':"scan,motor,start,stop,step,x,y,z,th,chi,phi,T,hv,exit_slit,GRT,ID_SP,ID_RBV,ID_Mode,ID_QP,TEY_1,TEY_2,time,comment"
         }
     return header_list
 
-def ARPES_log_entries():
+def _ARPES_log_entries():
     """
     endstation info for log file
 
@@ -312,7 +320,7 @@ def ARPES_log_entries():
 ##############################################################################################################
 ##############################             ARPES scanRecord           ##############################
 ##############################################################################################################     
-def ARPES_scan_before_sequence(**kwargs):
+def _ARPES_scan_before_sequence(**kwargs):
     """
     writes the user string sequence to happen at the beginning of a scan
     returns before_scan_pv = pv for userStringSeq for before scan
@@ -334,7 +342,7 @@ def ARPES_scan_before_sequence(**kwargs):
     caput(before_scan_pv+".DESC","Before Scan")
 
     #sequence put CAs in passive
-    ca_list = ARPES_detector_list()
+    ca_list = _ARPES_detector_list()
     for (i,ca) in enumerate(ca_list):
         ca_pv = Keithley_pv(ca[0], ca[1])+':read.SCAN PP NMS'
         caput(before_scan_pv+".LNK" +str(i+1),ca_pv)
@@ -342,15 +350,15 @@ def ARPES_scan_before_sequence(**kwargs):
 
     return before_scan_proc
 
-def ARPES_ca_live_sequence(**kwargs):
+def _ARPES_ca_live_sequence(**kwargs):
     """
     """
     kwargs.setdefault('seq_num',7)
 
-    ca_live_sequence_proc = ca_live_sequence(iex.BL.ioc,kwargs['seq_num'],ARPES_detector_list())
+    ca_live_sequence_proc = ca_live_sequence(iex.BL.ioc,kwargs['seq_num'],_ARPES_detector_list())
     return ca_live_sequence_proc
 
-def ARPES_scan_after_sequence(**kwargs):
+def _ARPES_scan_after_sequence(**kwargs):
     """
     writes the user string sequence to happen at the end of a scan
     returns after_scan_pv = pv for userStringSeq for after scan
@@ -376,7 +384,7 @@ def ARPES_scan_after_sequence(**kwargs):
     caput(after_scan_pv+".DESC","After Scan")
         
     ## Put All relevant CA back in live mode
-    ca_live_sequence_proc = ARPES_ca_live_sequence(**kwargs)
+    ca_live_sequence_proc = _ARPES_ca_live_sequence(**kwargs)
     caput(after_scan_pv+".LNK1",ca_live_sequence_proc+" PP NMS")
     caput(after_scan_pv+".DO1",1)
 
@@ -401,7 +409,7 @@ def ARPES_scan_after_sequence(**kwargs):
     return after_scan_proc
 
 
-def ARPES_detector_triggers_sequence(**kwargs):    # do we need to add 29idb:ca5 ???
+def _ARPES_detector_triggers_sequence(**kwargs):    # do we need to add 29idb:ca5 ???
     """
     """
     kwargs.setdefault('seq_num',8)
@@ -414,7 +422,7 @@ def ARPES_detector_triggers_sequence(**kwargs):    # do we need to add 29idb:ca5
     userStringSeq_clear(scan_ioc,seq_num=kwargs['seq_num'])
     caput(detector_triggers_pv+".DESC","ARPES_Trigger1")
     
-    ca_list = ARPES_detector_list()
+    ca_list = _ARPES_detector_list()
     last = len(ca_list)
     for i,ca in enumerate(ca_list):
         ca_pv = Keithley_pv(ca[0], ca[1])+':read.PROC CA NMS'
@@ -423,18 +431,18 @@ def ARPES_detector_triggers_sequence(**kwargs):    # do we need to add 29idb:ca5
 
     return detector_triggers_proc
 
-def ARPES_trigger_dictionary(**kwargs):
+def _ARPES_trigger_dictionary(**kwargs):
     """
     need to do something
     """
     trigger_dictionary = {
-        1:ARPES_detector_triggers_sequence(**kwargs),
+        1:_ARPES_detector_triggers_sequence(**kwargs),
     }
     return trigger_dictionary
 
 
 ##############################################################################################################
-##############################             ARPES Motor Scan Set Up        ##############################
+##############################             ARPES Motor Endcoders      ##############################
 ##############################################################################################################
 def ARPES_motor_encoder_sync():
     ioc = "29idc:"
@@ -474,7 +482,7 @@ def _ARPES_MoveSequence(destination):
         if the theta encoder stops reading the manipulator will CRASH!!!!
     """
     (x,y,z,th,chi,phi)=_ARPES_DefaultPosition(destination)
-    motor_dictionary = ARPES_motor_dictionary()
+    motor_dictionary = _ARPES_motor_dictionary()
     if x is None:
         print("Not a valid destination")
     else:
@@ -509,7 +517,7 @@ def _ARPES_limits_set(destination):
 
     Previously: ARPES_LimitsSet
     """
-    motor_dictionary = ARPES_motor_dictionary()
+    motor_dictionary = _ARPES_motor_dictionary()
     if destination == 'measure':
         (x,y,z,th,chi,phi)=_ARPES_DefaultPosition("measure")
         limits={'x':[5.5,-7],'y':[7,-5],'z':[-6,-310],'th':[th+35,th-25],'chi':[45,-15],'phi':[120,-120]}
@@ -534,7 +542,7 @@ def ARPES_transfer(chi=0,phi=0,**kwargs):
         EA_HV_Off=True; Turns off the EA HV
         Close_CBranch=True;  closes the C-shutter and the C-valve (main chamber to BL)
     """
-    ARPESgo2("transfer",**kwargs)
+    _ARPESgo2("transfer",**kwargs)
 
 def ARPES_measure(**kwargs):
     """
@@ -543,7 +551,7 @@ def ARPES_measure(**kwargs):
         chi=None # specify a value to move chi
         phi=None # specifiy a value to move phi
     """
-    ARPESgo2("measure",**kwargs)
+    _ARPESgo2("measure",**kwargs)
 
 def ARPES_LEED(**kwargs):
     """
@@ -555,9 +563,9 @@ def ARPES_LEED(**kwargs):
         chi=None # specify a value to move chi
         phi=None # specifiy a value to move phi
     """
-    ARPESgo2("LEED",**kwargs)    
+    _ARPESgo2("LEED",**kwargs)    
 ####################################################################################################
-def ARPESgo2(destination,**kwargs):
+def _ARPESgo2(destination,**kwargs):
     """
     Moves the ARPES manipulator to the default position: 
     destination: "transfer", "measure", "LEED"
@@ -585,7 +593,7 @@ def ARPESgo2(destination,**kwargs):
     #Move x,y,z,th
     _ARPES_MoveSequence(destination)
     #Move chi and phi back to 0
-    motor_dictionary = ARPES_motor_dictionary()
+    motor_dictionary = _ARPES_motor_dictionary()
     if kwargs["chi"] is not None:
         caput(motor_dictionary['chi'][1],kwargs["chi"])
     if kwargs["phi"] is not None:
@@ -595,7 +603,7 @@ def ARPESgo2(destination,**kwargs):
 ##############################################################################################################
 ##############################             ARPES pvs for GUIs (caQtDM)        ##############################
 ##############################################################################################################
-def ARPES_StringCalc_trigger2_active():
+def _ARPES_StringCalc_trigger2_active():
     """
     setup a string calc to be used by caQtDM to indicate that the trigger 2 is filled
     """
diff --git a/iexcode/instruments/IEX_endstations.py b/iexcode/instruments/IEX_endstations.py
index b24b05b81d48731de8031b63d1041f3905a35be7..6827863438f5798abd2756a307dd61f7caeb276b 100644
--- a/iexcode/instruments/IEX_endstations.py
+++ b/iexcode/instruments/IEX_endstations.py
@@ -1,11 +1,5 @@
-from math import floor
-from re import M
-import time
-from tkinter.messagebox import NO
-
-from epics import caput
-
 from iexcode.instruments.scanRecord import ScanRecord
+from iexcode.instruments.utilities import print_warning_message
 
 import iexcode.instruments.cfg as iex
 
@@ -41,7 +35,7 @@ class Endstation:
 
     """
 
-    def __init__(self,endstation_name,scan_ioc,xrays,BL_mode,Motors=None):
+    def __init__(self,endstation_name,scan_ioc,xrays,BL_mode,Motors=None,**kwargs):
         """
         intializes the several beamline variables 
 
@@ -55,8 +49,10 @@ class Endstation:
             BL.prefix => 'ARPES_','Kappa_'
             BL.ioc => previously: BL_ioc()
             BL.Motors => motor calls
+            BL.safe_state => function to put endstation in a 'safe state'
+            BL.endstation_get => function to return endstation status
 
-            intialization does not set default detectors and logging for .mda
+            Note intialization does not set default detectors and logging for .mda
             
         """
        
@@ -71,7 +67,8 @@ class Endstation:
         self.mda = ScanRecord(scan_ioc)
         self.Motors = Motors
 
-        #global BL here
+        self.safe_state = None
+        self.endstation_get = None
         
         BL_mode_list = ['user','staff']
 
@@ -104,14 +101,16 @@ class Endstation:
                 self.folder = 'b' 
                 self.prefix = endstation_name+"_"
         else:
-            print('Not a valid BL_mode choice')
-            print('BL_modes: '+BL_mode_list) 
+            message = 'Not a valid BL_mode choice\n'
+            message += 'BL_modes: '+BL_mode_list
+            print_warning_message(message)
             return  
 
-    def set_logfile_path():
-        """
-        sets the default logfile path
-        """
+        if 'safe_state' in kwargs:
+            self.safe_state = kwargs['safe_state']
+        if 'endstation_get' in kwargs:
+            self.endstation_get = kwargs['endstation_get']
+
 
 ##############################################################################################################
 ##############################               BL commands            ##############################
@@ -139,3 +138,6 @@ def BL_mda_filepath():
     returns the mda file prefix
     """
     return iex.BL.filepath
+
+##############################################################################################################
+
diff --git a/iexcode/instruments/Kappa.py b/iexcode/instruments/Kappa.py
index 0f40c56b9b223d43a9de9e0d1ff812a7e559197e..ba236cc780fefda4d831fa98d23185e165b7c0d2 100644
--- a/iexcode/instruments/Kappa.py
+++ b/iexcode/instruments/Kappa.py
@@ -6,14 +6,12 @@ from epics import caget, caput,PV
 
 import iexcode.instruments.cfg as iex
 from iexcode.instruments.IEX_endstations import Endstation
-
-iex.BL = Endstation(endstation_name,scan_ioc,xrays,BL_mode,Motors=None)
-
+from iexcode.instruments.cameras import _enable_endstation_cameras
 
 from iexcode.instruments.staff import staff_detector_dictionary
 from iexcode.instruments.files_and_folders import check_run,make_user_folders,folder_mda
 from iexcode.instruments.staff import staff_detector_dictionary
-from iexcode.instruments.xrays import xrays_detector_dictionary,xrays_reset,xrays_get_all
+from iexcode.instruments.xrays import _xrays_detector_dictionary,_xrays_reset,xrays_get_all
 
 from iexcode.instruments.conversions_constants import *
 from iexcode.instruments.utilities import *
@@ -33,14 +31,11 @@ from iexcode.instruments.MPA import MPA
 from iexcode.instruments.spec_stuff import folders_spec
 
 default_ioc = '29idKappa:'
-
-global tey, d3, d4, mesh, tthdet
-
 #############################################################################
 def Kappa_init(*userName,**kwargs):
     """
     used to intialize the Endstation class which carries scanRecord, logging ... parameters
-    returns global detectors relavent to this endstation (tey,ca15)
+    returns global detectors relavent to this endstation (tey,d3,d4,mesh,Kappa_scaler_pv,tth_pv,tthdet)
 
         *userName is an optional parameter, will be prompted if set_folders=True
 
@@ -59,49 +54,52 @@ def Kappa_init(*userName,**kwargs):
     #motors
     physical_motors = ['x','y','z','tth','kth','kap','kphi']
     psuedo_motors = ['th','chi','phi']
-    Kappa_Motors = Motors('Kappa',Kappa_motor_dictionary(),physical_motors,psuedo_motors)
+    global Kappa_Motors
+    Kappa_Motors = Motors('Kappa',_Kappa_motor_dictionary(),physical_motors,psuedo_motors)
 
     #endstation
     iex.BL = Endstation('Kappa',kwargs['scan_ioc'],kwargs['xrays'],kwargs['BL_mode'],ARPES_Motors)
 
-    #scan
-    if kwargs['BL_mode']=='staff':
-        detector_dictionary = staff_detector_dictionary()
-    else:
-        detector_dictionary = Kappa_detector_dictionary()
-
-    mda_scanRecord = ScanRecord(kwargs['scan_ioc'],detector_dictionary,
-    Kappa_trigger_dictionary(scan_ioc,scan_dim,),Kappa_scan_before_sequence(scan_ioc,scan_dim),Kappa_scan_after_sequence(scan_ioc,scan_dim))
+    #setting folders
+    if kwargs['set_folders']:
+        if iex.BL.mode == 'staff':
+            user_name = 'staff'
+        else:
+            if len(userName)==0:
+                user_name = input('user name: ')
+            else:
+                user_name = userName[0]
+        print(user_name)
+        folders_Kappa(user_name,**kwargs)
 
-    
+        #update for default scanRecord advanced parameters
+        iex.BL.mda.log('Kappa',user_name,_Kappa_log_header(),_Kappa_log_entries)
 
     #global detectors
+    global tey,d3,d4,mesh,Kappa_scaler_pv,tth_pv,tthdet
     tey = SRS("29idMZ0:scaler1.S2", '29idd:A1')
     d3 = SRS("29idMZ0:scaler1.S3", '29idd:A2')
     d4 = SRS("29idMZ0:scaler1.S4", '29idd:A3')
     mesh = SRS("29idMZ0:scaler1.S14", '29idd:A4')
     Kappa_scaler_pv = '29idMZ0:scaler1.CNT'
-    tth_pv = Kappa_motor_dictionary('tth')[3]
+    tth_pv = _Kappa_motor_dictionary('tth')[3]
     iex.mpa = MPA()
     tthdet = Kappa_Detector(Kappa_Motors)
-
-    #setting folders
-    if 'set_folders':
-        if iex.BL.mode == 'staff':
-            user_name = 'staff'
-        else:
-            user_name = input('user name: ')
-        folders_Kappa(user_name,**kwargs)
     
-    #resetting
-    if 'reset':
-        Kappa_reset()
+    #resetting everything
+    if kwargs['reset']:
+        Kappa_reset(**kwargs)
 
+    #enable cameras
+    _enable_endstation_cameras()
 
+    print ('Kappa initalized')
+    #return any detectors or other parameters that you want access to from jupyter
+    return tey,d3,d4,mesh,Kappa_scaler_pv,tth_pv,tthdet
 ##############################################################################################################
 ##############################                    detectors and motors                ##############################
 ##############################################################################################################
-def Kappa_detector_list():
+def _Kappa_detector_list():
     """
     list of detectors to trigger 
 
@@ -111,7 +109,7 @@ def Kappa_detector_list():
     return ca_list
 
 
-def Kappa_detector_dictionary(**kwargs):
+def _Kappa_detector_dictionary(**kwargs):
     """
     returns a dictionary of the default detectors
 
@@ -180,7 +178,7 @@ def Kappa_detector_dictionary(**kwargs):
     return det_dict
 
 
-def Kappa_motor_dictionary(name):
+def _Kappa_motor_dictionary(name):
     """
     motor_dictionary = {name:[rbv,val,spmg,pv]} for physical and psuedo/Euler motors
     usage:
@@ -283,8 +281,18 @@ def Kappa_reset():
     """
     resets scanRecord, current amplifiers, mono limits and lakeshore
     """
+    #writing default parameters to iex.BL.mda
+    if iex.BL.mode=='staff':
+        iex.BL.mda.detector_dictionary = staff_detector_dictionary(kwargs['xrays'])
+    else:
+         iex.BL.mda.detector_dictionary = _Kappa_detector_dictionary(kwargs['xrays'])
+    iex.BL.mda.trigger_dictionary = _Kappa_trigger_dictionary(**kwargs)
+    iex.BL.mda.scan_before_sequence = _Kappa_scan_before_sequence(**kwargs)
+    iex.BL.mda.scan_after_sequence = _Kappa_scan_after_sequence(**kwargs)    
+    
     #resetting the scanRecord
-    iex.BL.mda.reset()
+    print("resetting the scanRecord - "+iex.BL.ioc)
+    iex.BL.mda.reset_all()
 
     #resetting the current amplifiers
     if iex.BL.xray:
@@ -292,26 +300,17 @@ def Kappa_reset():
     
     #resetting mono and anyother beamline stuff
     if iex.BL.xrays:
-        xrays_reset()
+        _xrays_reset()
 
-    #reseting the Kappa Lakeshore
+    #resetting mono and other beamline stuff
+    if iex.BL.xrays:
+        _xrays_reset()
 
     #motors home and sync
-    SmarAct_motors_home()
-    PI_motors_sync()
+    _SmarAct_motors_home()
+    _PI_motors_sync()
     Euler_motors_sync()
 
-def Kappa_reminder_list(ioc):
-    """
-    resets scanRecord, current amplifiers, mono limits  and synchs motors
-    """
-    iex.BL.mda.reset()
-    if iex.BL.xray:
-        ca_reset_all()
-
-
-
-
 
 ##############################################################################################################
 ##############################                    get all                 ##############################
@@ -323,32 +322,36 @@ def Kappa_get_all(verbose=True):
     vals = {}
 
     #sample postion
-    motor_dictionary = Kappa_motor_dictionary()
+    motor_dictionary = _Kappa_motor_dictionary()
     for motor in motor_dictionary.keys():
         vals[motor]=Kappa_Motors.get(motor,verbose=False)
 
-    #endstation pvs
+    #endstation/branch pvs
     extra_pvs = Kappa_extra_pvs()
     for key in extra_pvs.keys():
         vals.update(key,caget(extra_pvs[key]))
+    if iex.BL.xrays:
+        vals.update('exit_slit',slit3D_get())
 
     #beamline info
     if iex.BL.xray:
         beamline_info = xrays_get_all()
-        #vals.update(beamline_info) 
+        vals.update(beamline_info) 
 
     mesh.get()
     vals.update({'mesh':mesh.current})
 
     if verbose:
+        print("-----------------------------------------------------------")   
         for key in vals:
             print(key+" = "+vals[key])
+        print("-----------------------------------------------------------")   
     return vals
 
 ##############################################################################################################
 ##############################                         logging                  ##############################
 ##############################################################################################################
-def Kappa_log_header():
+def _Kappa_log_header():
     """
     header for the log file
     """
@@ -357,7 +360,7 @@ def Kappa_log_header():
     header_list = {'Kappa':h}
     return header_list 
 
-def Kappa_log_entries():
+def _Kappa_log_entries():
     """
     enstation info for log file
 
@@ -390,7 +393,7 @@ def Kappa_log_entries():
 ##############################################################################################################
 ##############################             Kappa scanRecord           ##############################
 ##############################################################################################################
-def Kappa_scan_before_sequence(scan_ioc,scan_dim,**kwargs):
+def _Kappa_scan_before_sequence(scan_ioc,scan_dim,**kwargs):
     """
     writes the user string sequence to happen at the beginning of a scan
     returns before_scan_pv = pv for userStringSeq for before scan
@@ -417,7 +420,7 @@ def Kappa_scan_before_sequence(scan_ioc,scan_dim,**kwargs):
 
     return before_scan_proc
 
-def Kappa_scan_after_sequence(scan_ioc,scan_dim,**kwargs):
+def _Kappa_scan_after_sequence(scan_ioc,scan_dim,**kwargs):
     """
     writes the user string sequence to happen at the end of a scan
     returns after_scan_pv = pv for userStringSeq for after scan
@@ -467,7 +470,7 @@ def Kappa_scan_after_sequence(scan_ioc,scan_dim,**kwargs):
 
     return after_scan_proc
 
-def Kappa_detector_triggers_sequence(scan_ioc,scan_dim,**kwargs):    # do we need to add 29idb:ca5 ???
+def _Kappa_detector_triggers_sequence(scan_ioc,scan_dim,**kwargs):    # do we need to add 29idb:ca5 ???
     """
     """
     kwargs.setdefault(seq_num,8)
@@ -484,7 +487,7 @@ def Kappa_detector_triggers_sequence(scan_ioc,scan_dim,**kwargs):    # do we nee
     caput(detector_triggers_pv+".LNK" +str(1),scaler_pv)
     caput(detector_triggers_pv+".WAIT"+str(1),"After"+str(last))
     
-    ca_list = Kappa_detector_list()
+    ca_list = _Kappa_detector_list()
     last = len(ca_list)
     for i,ca in enumerate(ca_list):
         ca_pv = Keithley_pv(ca[0], ca[1])+':read.PROC CA NMS'
@@ -493,12 +496,12 @@ def Kappa_detector_triggers_sequence(scan_ioc,scan_dim,**kwargs):    # do we nee
 
     return detector_triggers_proc
 
-def Kappa_trigger_dictionary(scan_ioc,scan_dim,**kwargs):
+def _Kappa_trigger_dictionary(scan_ioc,scan_dim,**kwargs):
     """
     need to do something
     """
     trigger_dictionary = {
-        1:Kappa_detector_triggers_sequence(scan_ioc,scan_dim,**kwargs),
+        1:_Kappa_detector_triggers_sequence(scan_ioc,scan_dim,**kwargs),
     }
     return trigger_dictionary
 
@@ -509,7 +512,6 @@ def Kappa_trigger_dictionary(scan_ioc,scan_dim,**kwargs):
 ##############################        Kappa  Motor Scan Set Up        ##############################
 ##############################################################################################################
 
-
 def Kappa_sample_Euler_list():
     """
     returns list of motor names used by mvsample
@@ -517,7 +519,6 @@ def Kappa_sample_Euler_list():
     motor_list = ['th','chi','phi']
     return motor_list
 
-
 def Kappa_4c_mprint():
     """
     returns the dictionary of the current sample position in 4c units 
@@ -529,7 +530,7 @@ def Kappa_4c_mprint():
     positions={}
     motors=Kappa_sample_Euler_list()
     for motor in motors:
-        positions.update(motor,Kappa_motor_dictionary()(motor)[0])
+        positions.update(motor,_Kappa_motor_dictionary()(motor)[0])
     return positions
 
 def Kappa_4c_move(th_chi_phi_list):
@@ -544,48 +545,46 @@ def Kappa_4c_move(th_chi_phi_list):
     for motor,i in enumerate(motor_list):
         Kappa_Motors.get(motor,verbose=True)
 
-   
-
-def SmarAct_motor_list():
+def _SmarAct_motor_list():
     """
     returns a list of the motor names for the SmarAct motors in the Kappa
     """
     return ['x','y','z']
 
-def SmarAct_motors_home():
+def _SmarAct_motors_home():
     """
     Homes the piezo (x,y,z). Home position is middle of travel
 
     Previously: Home_SmarAct_Motor
     """
-    motor_dictionary = Kappa_motor_dictionary()
-    for motor in SmarAct_motor_list():
+    motor_dictionary = _Kappa_motor_dictionary()
+    for motor in _SmarAct_motor_list():
         pv = motor_dictionary[motor][3]
         caput(pv+'.HOMF',1)
         sleep(10)
     print('SamrAct motors VAL homed')
 
-def SmarAct_enable():
-    motor_dictionary = Kappa_motor_dictionary()
-    for motor in SmarAct_motor_list():
+def _SmarAct_enable():
+    motor_dictionary = _Kappa_motor_dictionary()
+    for motor in _SmarAct_motor_list():
         spmg = motor_dictionary[motor][2]
         caput(spmg,3)  # 3=Go
 
-def SmarAct_disable():
-    motor_dictionary = Kappa_motor_dictionary()
-    for motor in SmarAct_motor_list():
+def _SmarAct_disable():
+    motor_dictionary = _Kappa_motor_dictionary()
+    for motor in _SmarAct_motor_list():
         spmg = motor_dictionary[motor][2]
         caput(spmg,0)  # 1=Stop
 
-def PI_motor_list():
+def _PI_motor_list():
     """
     returns a list of the motor names for the SmarAct motors in the Kappa
     """
     return ['kap','kth','tth']
 
-def PI_motors_sync():
-    motor_dictionary = Kappa_motor_dictionary()
-    for motor in PI_motor_list():
+def _PI_motors_sync():
+    motor_dictionary = _Kappa_motor_dictionary()
+    for motor in _PI_motor_list():
         val_pv = motor_dictionary[motor][1]
         rbv_pv = motor_dictionary[motor][0]
         current_rbv=caget(rbv_pv)
@@ -608,7 +607,7 @@ def Kappa_kphi_reset_zero(val):
     resets the zero for the kphi motor
 
     """
-    kphi_pv = Kappa_motor_dictionary()['kphi'][3]
+    kphi_pv = _Kappa_motor_dictionary()['kphi'][3]
     caput(kphi_pv+".SET",1)    # 1 = Set
     sleep(0.5)
     caput("kphi_pv.VAL",val)
@@ -622,9 +621,7 @@ def Kappa_tth_reset_zero():
     """
     tthdet.tth0_set()
 
-
-
-def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,**kwargs):
+def th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,**kwargs):
     """
     Scans th2th with variable gain on SRS# (srs_num).
     Gain is specified for a given th2th range by building tables as follow:
@@ -665,7 +662,7 @@ def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,**kwarg
 
     kth_offset = Kappa_kth_offset_get()
 
-    motor_dictionary = Kappa_motor_dictionary()
+    motor_dictionary = _Kappa_motor_dictionary()
     kth_val,kth_rbv,kth_spmg,kth_pv = motor_dictionary['kth']
     tth_val,tth_rbv,tth_spmg,tth_pv = motor_dictionary['tth']
 
@@ -699,7 +696,7 @@ def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,**kwarg
         iex.BL.mda.table_reset_after(**kwargs)
         scaler_cts(verbose=False)
 
-def Kappa_scan_th2th(tth_start,tth_stop,tth_step,th_offset,**kwargs):
+def scan_th2th(tth_start,tth_stop,tth_step,th_offset,**kwargs):
     """
     Used for a linear (not table) scan where th =  tth /2 + th_offset
     **kwargs
@@ -721,8 +718,8 @@ def Kappa_scan_th2th(tth_start,tth_stop,tth_step,th_offset,**kwargs):
     print('th: '+str(th_start)+"/"+str(th_stop)+"/"+str(tth_step/2.0))
     
     #write to the scanRecord
-    th_val,th_rbv,th_spmg,th_pv = Kappa_motor_dictionary['th']
-    tth_val,tth_rbv,tth_spmg,tth_pv = Kappa_motor_dictionary['tth']
+    th_val,th_rbv,th_spmg,th_pv = _Kappa_motor_dictionary['th']
+    tth_val,tth_rbv,tth_spmg,tth_pv = _Kappa_motor_dictionary['tth']
 
     kwargs.update("positioner_num",2)
     iex.BL.mda.fillin(th_val,th_rbv,th_start,th_stop,th_step,**kwargs)
@@ -738,7 +735,7 @@ def Kappa_scan_th2th(tth_start,tth_stop,tth_step,th_offset,**kwargs):
         scaler_cts(verbose=False)
 
 
-def scan_th2th_table(tth_table,th0,**kwargs):
+def th2th_table(tth_table,th0,**kwargs):
     """
     Create a table for tth, e.g.:
         mytable_tth=[]
@@ -763,8 +760,8 @@ def scan_th2th_table(tth_table,th0,**kwargs):
     tth_table=np.asarray(tth_table)
     th_table=tth_table/2.0+th0
 
-    th_val,th_rbv,th_spmg,th_pv = Kappa_motor_dictionary['th']
-    tth_val,tth_rbv,tth_spmg,tth_pv = Kappa_motor_dictionary['tth']
+    th_val,th_rbv,th_spmg,th_pv = _Kappa_motor_dictionary['th']
+    tth_val,tth_rbv,tth_spmg,tth_pv = _Kappa_motor_dictionary['tth']
 
     #write to the scanRecord
     kwargs.update("positioner_num",1)
@@ -790,22 +787,22 @@ def scan_th2th_table(tth_table,th0,**kwargs):
 #############################################################################################################
 ##############################             Preset Positions        ##############################
 ##############################################################################################################
-def KappaTransfer_StrSeq():
+def _KappaTransfer_StrSeq():
     #User= [    DESC,        x,        y,      z,        tth,       kth,       kap,    kphi]
     User = ["Kappa Transfer",0, -2650, -650, 0, 57, 0, -88]
     n=4
-    KappaPreset_StrSeq(n,User)
+    _KappaPreset_StrSeq(n,User)
 
 
-def KappaGrazing_StrSeq(): #Need to determine positions and then add to the Kappa graphic
+def _KappaGrazing_StrSeq(): #Need to determine positions and then add to the Kappa graphic
     #Dial= [    DESC,        x,        y,      z,        tth,       kth,       kap,    kphi]
     User = ["Kappa Grazing",0, 0, 0, 0, 57.045, 134.76,57.045]
     n=3
-    KappaPreset_StrSeq(n,User)
+    _KappaPreset_StrSeq(n,User)
 
 def Kappa_ResetPreset():
-    KappaGrazing_StrSeq()
-    KappaTransfer_StrSeq()
+    _KappaGrazing_StrSeq()
+    _KappaTransfer_StrSeq()
 
 
 
@@ -832,72 +829,6 @@ def Kappa_light(ON_OFF):
     print(("Turning light "+ON_OFF+"."))
 
 
-
-
-def Kappa_detector_triggers_strSeq(**kwargs):    # do we need to add 29idb:ca5 ???
-    """
-    """
-    kwargs.setdefault(seq_num,8)
-    seq_num=kwargs['seq_num']
-    
-    detector_triggers_pv,detector_triggers_proc = userStringSeq_pvs(iex.BL.ioc, seq_num)
-       
-    #clear the userStringSeq
-    userStringSeq_clear(iex.BL.ioc,seq_num=kwargs['seq_num'])
-    caput(detector_triggers_pv+".DESC","Kappa_Trigger1")
-
-    #no triggers see ARPES_detector_triggers_sequence for example
-
-    return detector_triggers_proc
-
-
-
-
-
-
-def KappaPreset_StrSeq(n,User):
-    scanIOC="Kappa"
-    motorIOC="29idKappa:"
-    motor = ["m2","m3","m4","m9","m8","m7","m1"]
-    strSeq_pv = userStringSeq_clear(iex.BL.mda,n)
-
-    if User[0] == "Kappa Grazing":  phi0= 0
-    if User[0] == "Kappa Transfer": phi0= 57
-    caput(strSeq_pv+".DESC",User[0])
-    caput(strSeq_pv+".LNK1", "29idKappa:userCalcOut9.A CA NMS")       # MPA HV pV
-    caput(strSeq_pv+".DO1",0)                                       # MPA HV = 0
-    caput(strSeq_pv+".WAIT1","Wait")                                # Wait for completion
-    caput(strSeq_pv+".LNK2", "29idKappa:m1.VAL CA NMS")               # phi = phi0
-    caput(strSeq_pv+".DO2",phi0)                                       
-    caput(strSeq_pv+".WAIT2","Wait")                                # Wait for completion
-    for i in range(3,10):
-        caput(strSeq_pv+".LNK"+str(i),motorIOC+motor[i-3]+".VAL CA NMS")
-        caput(strSeq_pv+".DO"+str(i),User[i-2])
-        if i < 9:
-            caput(strSeq_pv+".WAIT"+str(i),"After8")
-
-
-
-
-    
- 
-    
-    
-def Bragg_Angle_CalcOut(d,eV,l):
-    n=7
-    userCalcOut_pv = userCalcOut_clear(iex.BL.mda,n)
-
-    h=4.135667516e-15
-    c=299792458
-    f=h*c*1e9*10
-    caput(userCalcOut_pv+"DESC","Bragg_Angle")
-    caput(userCalcOut_pv+"A",d)
-    caput(userCalcOut_pv+"B",l)
-    caput(userCalcOut_pv+"C",eV)
-    caput(userCalcOut_pv+"D",np.pi)
-    caput(userCalcOut_pv+"E",f)
-    caput(userCalcOut_pv+".CALC$","ASIN(B*E/(C*"+str(2)+"*A))*"+str(180)+"/D")
-
 ##############################################################################################################
 ########################        Scan Temp and Pressure           ##############################
 ##############################################################################################################
diff --git a/iexcode/instruments/beamline.py b/iexcode/instruments/beamline.py
index f8de3a0d8204d785696cb58ba3d3841e32b3cb10..d23df80732ec835298be39176ce35e93076a48d6 100644
--- a/iexcode/instruments/beamline.py
+++ b/iexcode/instruments/beamline.py
@@ -1,50 +1,28 @@
-
-"""
-short name for functions used with or without x-rays
-
-"""
-
 import numpy as np
 from time import sleep
 
 from epics import PV
 
 import iexcode.instruments.cfg as iex
+from iexcode.instruments.xrays import xrays_get_all
 
     
-
-
-
-
-##############################################################################################################
-##############################               Beeper          ##############################
-##############################################################################################################
-
-
-def endstation_cams_enable():
+def get_all(verbose=True):
     """
-    should live in cameras
+    returns the current beamline and endstation setting
+
     """
-    endstation=iex.BLendstation
+    vals={}
+    if verbose:
+        print("\n===========================================================")
     
-    cam_dict={'ARPES':[0,1,2],'Kappa':[3,4,6]}  # index of cam_list 
-    pvcam1=PV("29id_ps1:cam1:Acquire")
-    pvcam2=PV("29id_ps2:cam1:Acquire")
-    pvcam3=PV("29id_ps3:cam1:Acquire")
-    pvcam4=PV("29id_ps4:cam1:Acquire")
-    pvcam6=PV("29id_ps6:cam1:Acquire")
-    pvcam7=PV("29id_ps7:cam1:Acquire")
-    cam_list=[pvcam1,pvcam2,pvcam3,pvcam4,pvcam6,pvcam7]
-    sleep(0.1)
-    for pvcam in cam_list:                  # turn OFF all cam
-        try:
-            if pvcam.connected:  pvcam.put(0)
-        except:
-            pass
-    for i in cam_dict[endstation]:                 # turn ON relevant cam
-        try:
-            if cam_list[i].connected: cam_list[i].put(1)
-            else: print(cam_list[i].pvname+' not connected')
-        except:
-            pass
-
+    if iex.BL.xrays:
+        vals.update(xrays_get_all(verbose))
+    
+    vals.update(iex.BL.endstation_get)
+    
+    if verbose:
+        print("\n===========================================================")
+    
+    return vals
+    
\ No newline at end of file
diff --git a/iexcode/instruments/cameras.py b/iexcode/instruments/cameras.py
index 3cfb114e040ed54f849a6a0b6eed51a96f5d5d96..87c90a964648fe5360c029a4aad5d6c3aaba289f 100644
--- a/iexcode/instruments/cameras.py
+++ b/iexcode/instruments/cameras.py
@@ -1,11 +1,15 @@
 
-from epics import caget, caput
+from epics import caget,caput,PV
 
-from iexcode.instruments.userCalcs import userStringSeq_clear
+import iexcode.instruments.cfg as iex
 from iexcode.instruments.AD_utilities import *
 from iexcode.instruments.IEX_endstations import *
 
-def cam_pv_dictionary(cam_num):
+##############################################################################################################
+##############################              Camera PV dictionary            ##############################
+##############################################################################################################
+
+def _pv_dictionary():
     """
     dictionary of pv names for the beamline cameras
     """
@@ -17,14 +21,42 @@ def cam_pv_dictionary(cam_num):
         5:"29idarv5:",
         6:"29id_ps6:",
     }
-    return d[cam_num]
+    return d
 
-def cam_scan_setup(cam_num,ADtype='TIFF',**kwargs):
+##############################################################################################################
+##############################             Endstation Cameras           ##############################
+##############################################################################################################
+   
+def _enable_endstation_cameras(unused_off=True):
     """
-    sets up the BL scanRecord to trigger the camera (trigger - 2)
+    Turns on cameras related to a given endstation if they are connected
+    unused_off=True turns off other cameras
+
     """
-    ADplugin = cam_pv_dictionary(cam_num)+ADtype+":"
-    ADplugin_ScanSetup(ADplugin,BL.mda, **kwargs)  
+    endstation=iex.BL.endstation
+
+    #For new endstation modify here:
+    cam_dict={'ARPES':[0,1,2],'Kappa':[3,4,6]}  # index of cam_list 
+
+    d=_pv_dictionary()
+    for num in d.keys: 
+        pv=d[num]+"cam1:Acquire"   
+        #camera in list
+        if num in cam_dict[endstation]:
+            if PV(pv).connected:  
+                pv.put('Acquire')
+            else:
+                print(d[num]+" ioc in not running")
+        #camera not in list
+        else:
+            if unused_off:
+                if PV(pv).connected:  
+                    pv.put('Done')
+
+
+##############################################################################################################
+##############################             Camera Snapping an image         ##############################
+##############################################################################################################
 
 def cam_snap(cam_num,ADtype='TIFF',**kwargs):
     """
@@ -37,15 +69,28 @@ def cam_snap(cam_num,ADtype='TIFF',**kwargs):
                 False => leave saving enabled and camera in single acquision
 
     """
-    ADplugin = cam_pv_dictionary(cam_num)+ADtype+":"
-    AD_SaveFileSetup(ADplugin,BL.mda,**kwargs)
+    ADplugin = _pv_dictionary()[cam_num]+ADtype+":"
+    AD_SaveFileSetup(ADplugin,iex.BL.mda,**kwargs)
     AD_snap(ADplugin,**kwargs)
 
+
+
+
+##############################################################################################################
+##############################             Scanning with a camera           ##############################
+##############################################################################################################
+def cam_scan_setup(cam_num,ADtype='TIFF',**kwargs):
+    """
+    sets up the BL scanRecord to trigger the camera (trigger - 2)
+    """
+    ADplugin = _pv_dictionary()[cam_num]+ADtype+":"
+    ADplugin_ScanSetup(ADplugin,iex.BL.mda, **kwargs)  
+
 def cam_live(cam_num,ADtype='TIFF',**kwargs):
     """
     puts camera in no save and continuous
     a.k.a free run
 
     """
-    ADplugin = cam_pv_dictionary(cam_num)+ADtype+":"
-    AD_FreeRun(ADplugin,**kwargs)
+    ADplugin = _pv_dictionary()[cam_num]+ADtype+":"
+    AD_FreeRun(ADplugin,**kwargs)
\ No newline at end of file
diff --git a/iexcode/instruments/conversions_constants.py b/iexcode/instruments/conversions_constants.py
index 45f1aea59c570ce29108135e34ade471f665f24b..68cae3f1b8dc5238d21cddf6b9d115796d6414bd 100644
--- a/iexcode/instruments/conversions_constants.py
+++ b/iexcode/instruments/conversions_constants.py
@@ -96,6 +96,10 @@ def KtoE(k_theta,k_kappa,k_phi,k_arm=50):
     e_chi   = 2.0 * np.asin( np.sin(k_kappa*conv/2.0) * np.sin(k_ang) )
     e_phi   = k_phi*conv - delta
     #print round(e_theta,1),round(e_phi,1),round(e_chi,1)
+    def rounder(val):        # convert from rad to deg
+        conv = np.pi/180.0
+        roundVal=round(1000.0*val/conv)/1000.0
+        return roundVal
     theta = rounder(e_theta)+(57.045-kth_offset)
     chi   = rounder(e_chi)        # convert from rad to deg
     phi   = rounder(e_phi)
@@ -103,7 +107,4 @@ def KtoE(k_theta,k_kappa,k_phi,k_arm=50):
     return (theta,chi,phi)
 
 
-def rounder(val):        # convert from rad to deg
-    conv = np.pi/180.0
-    roundVal=round(1000.0*val/conv)/1000.0
-    return roundVal
+
diff --git a/iexcode/instruments/xrays.py b/iexcode/instruments/xrays.py
index 783f6bc8842520dda23c4ae5be0e60dbb811870e..7d70ebd02544f77e9f19e03e4c72da794e9825c5 100644
--- a/iexcode/instruments/xrays.py
+++ b/iexcode/instruments/xrays.py
@@ -16,7 +16,7 @@ from iexcode.instruments.shutters import *
 from iexcode.instruments.gate_valves import *
 from iexcode.instruments.diagnostics import *
 from iexcode.instruments.m3r import *
-from iexcode.instruments.beamline import endstation_cams_enable
+from iexcode.instruments.cameras import _enable_endstation_cameras
 from iexcode.instruments.utilities import print_warning_message,make_table, take_closest_value
 from iexcode.instruments.current_amplifiers import ca_average
 from iexcode.instruments.Logfile import log_update
@@ -26,7 +26,7 @@ mpa = iex.mpa
 ##############################################################################################################
 ##############################            resets and detector lists         ##############################
 ##############################################################################################################
-def xrays_reset(verbose=True):
+def _xrays_reset(verbose=True):
     if verbose:
         print("resetting the mono limits")
     mono_limits_reset()
@@ -35,7 +35,7 @@ def xrays_reset(verbose=True):
     xray_motor_encoder_sync()
 
 
-def xrays_detector_list():
+def _xrays_detector_list():
     """
     defualt detectors for the APRES endstation
     used by: 
@@ -52,7 +52,7 @@ def xrays_detector_list():
     return ca_list
 
 
-def xrays_detector_dictionary():
+def _xrays_detector_dictionary():
     """
     returns a dictionary of the default detectors
     
@@ -87,30 +87,31 @@ def xrays_detector_dictionary():
 ##############################            get beamline info         ##############################
 ##############################################################################################################
 
-def xrays_get_all(verbose=False):
+def xrays_get_all(verbose=True):
     """
     gets info about current beamline setting
     returns a dictionary
 
     """
-    #global BL
     vals={}
-    print("\n===========================================================")
-    vals.update(ID_get_all(verbose=True))
-    vals.update(mono_get_all(verbose=True))
-    print("-----------------------------------------------------------")
-    vals.update(slits_get_all(verbose=True))
-    vals.update(FMB_mirror_get(0,verbose=True))
-    vals.update(FMB_mirror_get(1,verbose=True))
-    vals.update(FMB_mirror_get(3,verbose=True))
-    print("-----------------------------------------------------------")
-    vals.update({iex.BL.endstation:iex.BL.Motors.mprint()})
-    print(iex.BL.endstation+" = ",iex.BL.Motors.mprint())
+
+    if verbose:
+        print("-----------------------------------------------------------")   
+    vals.update(ID_get_all(verbose=verbose))
+    vals.update(mono_get_all(verbose=verbose))
     
-    print("===========================================================")
+    if verbose:
+        print("-----------------------------------------------------------")
+    vals.update(slits_get_all(verbose=verbose))
+    vals.update(FMB_mirror_get(0,verbose=verbose))
+    vals.update(FMB_mirror_get(1,verbose=verbose))
+    vals.update(FMB_mirror_get(3,verbose=verbose))
+    if verbose:
+        print("-----------------------------------------------------------")
+
     return vals
 
-def xrays_log_entries(**kwargs):
+def _xrays_log_entries(**kwargs):
     """
     Writes CSV file for the MDA scans with the following default parameters:
     FilePath='/home/beams/29IDUSER/Documents/User_Folders/UserName/'
@@ -229,11 +230,10 @@ def energy(hv_eV,slit_coeff=1,m3r=True,verbose=True):
     m3r => if True optimizes the mirror for the d-branch only
     Previously: Set_BL, energy
     """
-    #global BL
     if iex.BL.xrays:
-        if hv_eV != energy_range_check(hv_eV):
+        if hv_eV != _energy_range_check(hv_eV):
             message_string = 'request photon energy '+str(hv_eV)+' not with the allowed range'
-            message_string = '\n closest allowed energy is '+str(energy_range_check(hv_eV))
+            message_string = '\n closest allowed energy is '+str(_energy_range_check(hv_eV))
             print_warning_message(message_string)
 
 
@@ -255,7 +255,7 @@ def energy(hv_eV,slit_coeff=1,m3r=True,verbose=True):
         message_string = 'iex.BL.xrays = False, energy is not set'
         print_warning_message(message_string)
 
-def energy_range_min_max():
+def _energy_range_min_max():
     """
     returns the min,max energies for the current grating/ID setting
     """
@@ -265,31 +265,39 @@ def energy_range_min_max():
     hv_min = np.max(ID_min, mono_min)
     return hv_min,hv_max
 
-def energy_range_check(hv):
+def _energy_range_check(hv):
     """
     checks if the energy is within the allowed range for both the mono
     and the ID. If outside the ranges set it to the closest allowed value
 
     Previously: SetRange()
     """
-    hv_min,hv_max = energy_range_min_max()
+    hv_min,hv_max = _energy_range_min_max()
     hv = np.min(hv_max,hv)
     hv = np.max(hv_min,hv)
     return hv
 
-def mvid(val):
+def mvid_SP(val):
     """
     Sets the ID absolute set point (not optimized , mono & apertures stay fixed).
     
     to go to most flux use energy
     """
-    ID_SP_set()
+    ID_energy_set(val)
+    ID_SP_set(val)
+
+def mvid(val):
+    """
+    Sets the ID peak to val (calibrated).
+
+    """
+    ID_energy_set(val)
+
 
-def scan_ID(ID_sp_start,ID_sp_stop,ID_sp_step,**kwargs):
+def _scan_ID(ID_sp_start,ID_sp_stop,ID_sp_step,**kwargs):
     """
     scan the ID set point
     """
-    #global BL
     val_pv,rbv_pv = ID_scan_pvs()
     iex.BL.mda.fillin(val_pv,rbv_pv,ID_sp_start,ID_sp_stop,ID_sp_step,**kwargs)
 
@@ -384,7 +392,7 @@ def scanE(start,stop,step,ID_offset=0,mesh='stay',average_pnts=1,scan_dim=1,**kw
         scan_dim
         positioner_settling_time = 0.2
     """
-    #global BL
+
     mda = iex.BL.mda
     ca_average(average_pnts)
 
@@ -485,7 +493,6 @@ def scanXAS_BL(start_stop_step_lists,**kwargs):
     kwargs.setdefault("mcp",True)    
     kwargs.setdefault('execute',True)
 
-    #global BL
     scan_dim=kwargs['scan_dim']
         
     #Setting up the ScanRecord for Mono and ID in Table mode
@@ -631,7 +638,7 @@ def switch_branch(branch, force=False, shutter=True,scan_reset=True,enable_cams=
                 BL.mda.reset()
 
             if enable_cams:
-                endstation_cams_enable(branch)
+                _enable_endstation_cameras(branch)
 
     else:
         print_warning_message(branch+' is not a valid branch selection')
diff --git a/iexcode/launch_ARPES.py b/iexcode/launch_ARPES.py
index d8538acdd3611db3b7921ea414e899b385a204a1..798ca5c1be0a3021ce82a5cdaf0af8eedd60e623 100644
--- a/iexcode/launch_ARPES.py
+++ b/iexcode/launch_ARPES.py
@@ -1,7 +1,19 @@
+
+import numpy as np
+from time import sleep
+
+from epics import caget,caput,PV
+
+#general stuff
+import iexcode.instruments.cfg as iex
+from iexcode.instruments.cameras import cam_snap
+from iexcode.instruments.utilities import playsound
+from iexcode.instruments.beamline import get_all
+
+#xray stuff
+
 from iexcode.instruments.ARPES import *
 from iexcode.instruments.electron_analyzer import * 
-#from iexcode.instruments.Scienta import * 
-
 
 from iexcode.instruments.current_amplifiers import * 
 from iexcode.instruments.Lakeshore_335 import *