mostly working and done on this branch