Control of magnetic properties