fixed bugs in bad lag calculations..