wrote tests for all methods