Initialized hw4 and completed first part with tree substitution