Tried to organize main better and use fixed time

I didnt finish the fixed time stuff