scala version with variable mutation methods