fixed main being stupid, though it was a horrible way to do it.