first working implementation of idea