implementing normal resolving
updating math
test code added