added separate testcases and challenge functions for clarity.