Refactored all the code to do it properly ; upated the readme in conseauences