prob putting too much in this function but whateer