JM solution

JM solution