Process array input by earlier correctly
Add more tests