implemented poor excuse for a delay function