modified the code to work with different version spec files