Drawing Algorithm optimization