Finishing touches

Made some final changes to a few functions