added hamm solution