worked on part c, trying to make part b better