Finished working implementation