changed functionnames and added comments