Transformed Perspective to scala