First partially working implementation