- added some casts for arrays
- moved some methods