changed return types to array