realized I was overcomplcating - cleaned up function order for readability