Added constexpr to some functions