added support for double array and negative numbers