half way through functions