New version with bug fixing.