Added pointers and made division function nicer