basic motion detector working