Problem5 and 6 is done