now returns main as an array