better version of serialize/unserialize with the array.