Initial commit of partially working implementation