Solved easy problem: implementation