added support for gnu99 and added time delay