Added a few comments
Added a few more if and things to main()