Made the code Object Orientated