Use arr+=() instead of subscript on some places.