--Fixed bug in main