fixed a few things and added comment