implemented functionQueue
fixed an incorrect test