changed to flat version. lot of fixes