new functions; +some changes