re-writing all of this so check back later