got onload to work added function version that doesn't work yet.