Electronic and structural properties of functional nanostructures