added back lib and some small changes in master