Added inline keyword to some functions