Implements waits. Throws test needs to be implemented