Tweaked some code