Fixed Bugs
Updated Code