updated Main to run in different states