added some documentation, fixed style isssue