Where/how is your arraydata variable defined?
If you understand what you're doing, you're not learning anything.