Changed method type2 so it works as planned.