Final version

Different calls for different functions + some functions now take
pointers as arguments, where it's useful.