added die function and noyes function.