fixed todos and cleaned up main