implemented majd's advice