rearrange code
fix top header comments