rewrote older functions for temp use for filip
merged pull/fetch