first working version with a few methods