part 3 done except one corner case