macro functions for drawing