Wrote more flexible U V generation