Title: Studies on the structure and stability of extended stellar atmospheres