code formatting, comments, singleton correction