cleaned up a little code need to fix single interval