first working version... it's ugly.