updated methods to return values instead of printing them, also updated
code to check methods are working