Added time measure regulation, code refactoring and comment fixes