added local version of betsey lib