generating electricity with magnets