adding loss variable
dock block added
form test and fixed