Playing with Val and Var inside a class