Updated Code

Made changes to code, fixed small issues