Fixes Issue #2, Cleaning code

Fixed the bug, made code more readable, added comments.
Performance: The script no longer wastes time if no comments.