moved sensors to local vars