code for  usual problems solutions