First working partial implementation