Spin dependent transport in magnetic nanostructures