change val to def (def stands for "defensive")