Initial implementation almost done