hopefully correct order for functions