main is almost done