dict value check and array reverse, plus tests