fixed bug in random magnetisation intialisation