Magnetism at nanoscale