Adding reworked code