added delay functionality but havent tested it