scala twiddle (working)