fixed mistakes from write code to match