fixed up according to @zero57's comments on github