cleaned up download code by using an array