Working solution with passing specs