rename asArray to toArray (fixes #5)