Added function for automatically distributing subviews in available space