adding fixes to code for arrays and hash