fixed some general bugs and implemented a light switch button action.