Changed Code to meet requirements