major update and polishing