change val to def