replaced multiple if´s with array