fixed bug with 2dim<->1dim array

still not good, lot of work todo =)