major update and fix bugs