merging of stevie's code