editing of the code for better viewing