Logic checked program 1