annotate code

minor rearrangement to layout