added some improvements (comments, better user interfaces, better parameters)