modified post of scala