my code snnipet for sharing