changed it using an array