Fixed all functions

all midje tests passed