added test for treks calls
fixed some ugly syntax