Replaced with solution to part4