added alternate code structure