Extensive updated, bug fixes