Made the code multi-user 

added important functions to the code.