updated readme, added sanity check for array sizes