implemented detect in view and a very basic environment