final submited solution