solved 2a and 2b
solved 2d