updated for modern Go