Validated code and made necessary changes