changed time to final int

bugs after one loop