Change var to public.  Add public to function definitions where missing.