More work on detect