removed dependancy of arraysize

replaced arraysize with a value variable