made some efficiency improvements