adjusted the code to standards