modified portion 2 & 3