Added Test cases, cleaned up input/output