Tweaking code, adding to other functions