added delay implementation and test