Added feature to handle arrays