Updated functions to create a single CS function with if input options
Stray semicolon