small changes based on Stefan's feedback.
edited functions through keyword args