some modifications regarding structure and added how to use