fix test case
add 8th test case
rafactor code
rafactor code
add main method
add main function
refactor code
add check function