made all functions inline