Calculations of electronic and magnetic structures in ultra-thin magnetic systems