created surfaceEnvironment. has bugs