first two problems working perfectly