added old PB code and renamed to scala