finished functions, didnt test them yet