first working version with modules