removed delay calculation code which was disabled via #if
also removed debug messages to cut down on delays