writtefln added for debug