Added the interactive input, moved all functions in a file and removed the namespace declaration. If I'm ever to split this up, I'll do at the very end.