Now uses multiple files and functions