Some modifications to the code. adil