added more detailed comments