added --update parameter and logic. Added function to compare two versions and tests for it.