Added comments
Moved version parsing into a function

Actually, the function already existed, I just forgot I could use it.