change of profile

new function and optimization