worked on frustum function