test and logic updated