Change main to a constructor