finished a part of the problem