Added unit test for lamp and better sending order function