first functional version
final working version