Add functions and modify for use