Added the complete procedure, lot of refactoring nedded