First principles approach to strongly correlated materials