Ab-initio calculations for dilute magnetic semiconductors