begining of nim