Removed redundant variable. Simplified main()