Fixed bug and added comment