fixed most bugs, still missing Lamp control and MMP