Wrote tests and made adjustments based on them