implement tests and account for edge cases