algorithm implementation & practise code sippnets