Drawing functions correctly