added doc strings and comments