corrected nested hash
added spec helper and a test