changed timing, fixed bugs