final fixes - fully working