Adapted base code