fixed a few timing issues. still needs work