modify according micheal's advice