first working version with materials