change function to inline