some changes in how parsing and ast is returned inside of main
added stuff and returned ast inside of main, also converted while loop to recursive