First version with arrays. Needs testing, no array operations yet.