Added hemisphere sampling code