Final version - all functions now use png()