test main fn.
tidy up.
remove comments.