about to majorly refactor and rewrite code