What two things are used for determining how a rock was formed??