gso and supporting functions added
removed some redundant declarations