major update of business rule logic, fixed several bugs