drawing functionality pseudocode