Many many changes and fixes, added 'for' construction