How to initialize variable m here? or maybe I'm wrong and should do it in a different way?