Finished both problems