adding building and sorting an array program