Added various functions related to drawing and layout.