aded notices and made code more readable