Update detect
Remove whitespace, remove leftover code