a lot of minor code updates