update from original, bug fixes