Combined first working implementation